Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
reeft_gps_test
/
css
/
include
:
db_connect_dir.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php //====================================================================================== // // Function: Connect to a database // // NOTE: config.php must have been include before you include this! // // Programmer: JKJ // Date : 2022-01-06 // // ------------------------------------------------------------------------------------------ // One year since the crazy fvcking Trump supporters tried to overcome US democracy. // FVCK TRUMP AND ALL HIS SUPPORTERS AND DF AND NY BOGERLIGE AND ALL RIGHT WING SHITHEADS!!!! // ------------------------------------------------------------------------------------------ // // Copyright Reeft A/S (c) - 2021 //====================================================================================== if ( $DFT_DATABASE_TO_USE == '*MYSQL') { //include "../include/web-connect-mysql.php"; $hostname = 'localhost'; $username = 'admin'; $password = 'costello'; $database = 'reeft_db'; try { $file_db = new PDO("mysql:host=$hostname;dbname=$database;charset=utf8mb4", $username, $password); // Set the PDO error mode to exception $file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); //$file_db->set_charset('utf8mb4'); //echo "Connected successfully"; } catch (PDOException $e) { echo "Connection failed: " . $e->getMessage(); } } else { if ( $DFT_DATABASE_TYPE == '*LOCAL' ) { $DFT_SQLLITE_IP = '../' . $DFT_SQLLITE_IP; } // Conncetion is found in /config/config.php $file_db = new PDO("sqlite:$DFT_SQLLITE_IP"); // Set errormode to exceptions $file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } ?>